<?php

defined('XINE_DIR') or define('XINE_DIR', dirname(__FILE__));

defined('DS') or define('DS', DIRECTORY_SEPARATOR);

defined('XINE_DEBUG') or define('XINE_DEBUG', true);

/**
 * Main class
 * 
 * @author RiderSx
 *
 */
class Xine
{
	protected static $__registry=array();
	
	public static function t ($string, $args=array(), $localeFrom=false, $localeTo=false) {
		
	}
	
	public static function _ ($string, $args=array(), $locale=false, $directory=false) {
		
	}
	
	public static function runApp () {
		if(file_exists(APP_DIR.DS.'app'.DS.'func.php')) require APP_DIR.DS.'app'.DS.'func.php';
		require XINE_DIR.DS.'func.php';
	}
	
	public static function import ($string, $forceInclude=false) {
		switch(substr($classNameString, 0, 4)) {
			case 'sys:':
				$dir = Xine::$alias[$classNameString];
			break;
			
			case 'app:': $dir = APP_DIR.DS.'app'.DS.'modules'.DS;
			break;
			
			default: throw new XStackException(Xine::_('The location of the module must be specified sys: or app:. Module %0 called', array($className)));
			break;
		}
	}
	
	/**
	 * Error parser
	 * 
	 * @param $exceptionClassName
	 * @param $isCritical
	 * @param $message
	 * @param $replaces
	 * @return unknown_type
	 */
	public function error ($exceptionClassName, $isCritical=false, $message, $replaces=array()) {
		
	}
	
	public function __get ($key) {
		return self::$__registry[$key];
	}
	
	public function __set ($key, $value) {
		self::$__registry[$key] = $value;
	}
}